namespace SimpleWebServices.Models
{
    using System.Diagnostics.CodeAnalysis;
    using System.Xml;
    using System.Xml.Serialization;
    using SimpleWebServices.Data;
    using SimpleWebServices.Web;

    [XmlRoot("organization")]
    public class Organization : Resource
    {
        public Organization()
        {
            this.Contacts = new ContactCollection();
        }

        [XmlAttribute("acronym")]
        public string Acronym
        {
            get;
            set;
        }

        [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly", Justification = "Can't deserialize if the setter is private.")]
        [XmlElement("contacts")]
        public ContactCollection Contacts
        {
            get;
            set;
        }

        [XmlIgnore]
        public override string Entity
        {
            get
            {
                Entity value = new Entity(base.Entity);
                value.Append(this.Acronym);
                value.Append(this.Contacts);

                return value;
            }
        }
    }
}